package com.veeder.datacollection.rs232.response;

public enum MagProbeFloatSize {
	FourInch(0), TwoInch(1), ThreeInch(2), OneInch(3), FourInchSep(4), Custom(9);

	private int index;

	private MagProbeFloatSize(int index) {
		this.index = index;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	
	public static MagProbeFloatSize getEnum(int index){
		MagProbeFloatSize result=null;
		for(MagProbeFloatSize e:MagProbeFloatSize.values()){
			if(e.index==index){
				result=e;
				break;
			}
		}
		
		return result;
	}
	
	public static Float getFloatSize(MagProbeFloatSize  e){
		Float size = 0.0f;
		if(e==null){
			return size;
		}
		switch(e)
		{
		case FourInch:
			size =4.0f;
			break;
		case TwoInch:
			size =2.0f;
			break;
		case ThreeInch:
			size =3.0f;
			break;
		case OneInch:	
			size =1.0f;
			break;
		case FourInchSep:
			size =4.0f;
			break;
		default:
			break;
		}
		
		return size;
	}
	
}
